package org.example.demo06;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Demo6 {
    //6.使用字符流 实现文件内容的拷贝 （源目录：C:/source/02.txt,目的目录：D:/target/02.txt）
    public static void main(String[] args) throws IOException {
        FileReader reader = new FileReader("C:/source/01.txt");
        FileWriter writer = new FileWriter("C:/source/02.txt");
        char[] buf = new char[1];
        int len = 0;
        while ((reader.read(buf) != -1)) {
            writer.write(buf);
        }
        reader.close();
        writer.close();


    }
}
